package com.itheima.job1;

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

public class test {
    public static void main(String[] args) {
        try (BufferedReader bis = new BufferedReader(new FileReader("e:/test/language.txt"))) {
            ArrayList<String> list = new ArrayList<>();
            String line;
            while((line = bis.readLine())!=null) {
                list.add(line);
            }
            Random r = new Random();
            int random = r.nextInt(list.size());
            System.out.println("年度最佳语言是："+list.get(random));
        }catch (IOException e){
            e.printStackTrace();
        }

    }
}
